import request from '../utils/request';

/**
 * 查询菜单分页
 * @param query
 * @returns {AxiosPromise}
 */
export const selectPage = query => {
    return request({
        url: 'rest/sysMenu/selectPage',
        method: 'POST',
        data: query
    });
};

/**
 * 查询菜单列表
 * @param query
 * @returns {AxiosPromise}
 */
export const selectList = query => {
    return request({
        url: 'rest/sysMenu/selectList',
        method: 'POST',
        data: query
    });
};

/**
 * 查看角色
 * @param query
 * @returns {AxiosPromise}
 */
export const selectSysMenu = query => {
    return request({
        url: 'rest/sysMenu/' + query,
        method: 'POST',
    });
};

/**
 * 新增角色
 * @param query
 * @returns {AxiosPromise}
 */
export const addSysMenu = query => {
    return request({
        url: 'rest/sysMenu/insert',
        method: 'POST',
        data: query
    });
};

/**
 * 编辑角色
 * @param query
 * @returns {AxiosPromise}
 */
export const updateSysMenu = query => {
    return request({
        url: 'rest/sysMenu/update',
        method: 'POST',
        data: query
    });
};

/**
 * 删除菜单
 * @param query
 * @returns {AxiosPromise}
 */
export const delSysMenu = query => {
    return request({
        url: 'rest/sysMenu/delete',
        method: 'POST',
        data: query
    });
};